import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '/index',
        component: () => import( '../views/home/indexView')
      },
      {
        path: '/indexs',
        component: () => import( '../views/home/indexViews')
      },
      {
        path: '/index/artGallery',
        component: () => import( '../views/home/ArtGalleryView')
      },{
        path: '/index/allClass',
        component: () => import( '../views/home/AllClassView')
      },
      {
        path: '/index/detail',
        component: () => import( '../views/home/DetailView')
      },
      {
        path: '/index/order',
        component: () => import( '../views/home/OrderView')
      },
      {
        path: '/cart',
        component: () => import(/* webpackChunkName: "about" */ '../views/cart/ShoppingCart')
      },
      {
        path: '/index/order',
        component: () => import(/* webpackChunkName: "about" */ '../views/home/OrderView')
      },
    ]
  },{
    path: '/userDetails',
    component: () => import(/* webpackChunkName: "about" */ '../views/home/UserDetailsView'),
    children: [
      {
        path: '/spaceinfo',
        component: () => import( '../views/home/userDetails/spaceinfo')
      },
      {
        path: '/changeinfo',
        component: () => import( '../views/home/userDetails/changeinfo')
      }
    ]
  },
  {
    path: '/login',
    component: () => import(/* webpackChunkName: "about" */ '../views/LoginView')
  },
  {
    path: '/admin/login',
    component: () => import(/* webpackChunkName: "about" */ '../views/AdminLogin')
  },
  {
    path: '/about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
    {
    path: '/admin',
    name: 'admin',
    component: () => import(/* webpackChunkName: "about" */ '../views/admin/AdminView'),
    children:[
      {
        path: '/admin/announcementList',
        component: () => import(/* webpackChunkName: "about" */ '../views/admin/AnnouncementManagement/AnnouncementList')
      },
      {
        path: '/admin/add-announcement',
        component: () => import(/* webpackChunkName: "about" */ '../views/admin/AnnouncementManagement/AddAnnouncement')
      },
      {
        path: '/admin/updateAnnouncement',
        component: () => import(/* webpackChunkName: "about" */ '../views/admin/AnnouncementManagement/AnnouncementUpdate')
      },
        {
        path: '/admin/',
        component: () => import(/* webpackChunkName: "about" */ '../views/admin/AdminManagement/AdminListView')
      },
        {
        path: '/admin/UserList',
        component: () => import( '../views/admin/UserManagement/UserList')
      },{
        path: '/admin/AddUser',
        component: () => import( '../views/admin/UserManagement/AddUser')
      },{
        path: '/admin/productList',
        component: () => import( '../views/admin/ProductManagement/ProductList')
      },{
        path: '/admin/AddProduct',
        component: () => import( '../views/admin/ProductManagement/AddProduct')
      },{
        path: '/admin/categoryList',
        component: () => import( '../views/admin/CategoryManagement/CategoryList')
      },{
        path: '/admin/AddCategory',
        component: () => import( '../views/admin/CategoryManagement/AddCategory')
      },{
        path: '/admin/classList',
        component: () => import( '../views/admin/ClassManagement/ClassList')
      },{
        path: '/admin/addclass',
        component: () => import( '../views/admin/ClassManagement/AddClass')
      },{
        path: '/admin/addBanner',
        component: () => import( '../views/admin/BannerManagement/AddBanner')
      },{
        path: '/admin/BannerList',
        component: () => import('../views/admin/BannerManagement/BannerList')
      },{
        path: '/admin/OrdersList',
        component: () => import( '../views/admin/OrdersManagement/OrdersList')
      },{
        path: '/admin/UpdateProduct',
        component: () => import('../views/admin/ProductManagement/UpdateProduct')
      },{
        path: '/admin/messagesList',
        component: () => import( '../views/admin/messages/messagesList')
      }
      ,{
        path: '/admin/addAdmin',
        component: () => import( '../views/admin/AdminManagement/AdminAddNewView.vue')
      }
      ,{
        path: '/orders/ordersList',
        component: () => import( '../views/admin/OrdersManagement/OrdersList.vue')
      }
    ]
  },
  {
    path: '/reg',
    component: () => import(/* webpackChunkName: "about" */ '../views/RegView.vue')
  }
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
